package cn.jobstart.command;

import cn.jobstart.common.spider.LiePinUtil;
import cn.jobstart.spider.service.ISpiderService;
import cn.jobstart.task.TalentTask;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author sunke
 * @version 1.0
 * @Description
 * @date 2023-10-08 21:21
 */

@Component
@Slf4j
public class TalentCommand implements CommandLineRunner {


    @Resource
    private ISpiderService spiderService;

    @Resource
    private TalentTask talentTask;

    @Resource
    private LiePinUtil liePinUtil;

    @Override
    public void run(String... args) throws Exception {

     //   liePinUtil.initAuthorization();
        while (true) {
            try {
              talentTask.run();
                Thread.sleep(60000 * 10);
            } catch (Exception e) {

            }

        }

    }
}
